const path = require('path')
const resolve = dir => {
  return path.join(__dirname,dir)
}
//const resolve = (dir,XXX) => path.join(__dirname,dir)

const BASE_URL = process.env.NODE_ENV === 'production' ? '/iview-admin' : '/'

module.exports = {
  lintOnSave: false,
  baseUrl: BASE_URL,
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('_c', resolve('src/components'))
      
  },
  //打包时,不生成.map 文件,减少我们打包的体积,加快打包速度
  productionSourceMap: false,
  //跨域配置: 1在后端的header 里设置一些属性,满足跨域的需求2使用devServer 配置代理信息
  devServer: {
    //proxy: 'http://localhost:4000'
  }
}